package pl.ptemich.nov2k13;

import java.awt.Dimension;
import java.awt.Toolkit;

import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.SlickException;

import pl.ptemich.tankwars.GraphicConstants;
import pl.ptemich.tankwars.tools.LoggingTools;

public class GameLauncher {

  /**
   * @param args
   */
  public static void main(String[] args) {
    AppGameContainer container;
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    try {
      Game instance = new Game();//Double.valueOf(screenSize.getWidth()).intValue(), 
                              //Double.valueOf(screenSize.getHeight()).intValue());
      container = new AppGameContainer(instance,
                                       Double.valueOf(screenSize.getWidth()).intValue(),
                                       Double.valueOf(screenSize.getHeight()).intValue(),
                                       GraphicConstants.FULL_SCREEN_DISABLED);
      container.setShowFPS(true);
      container.setTargetFrameRate(75);
      //container.setMouseGrabbed(true); // disable mouse cursor
      container.setVSync(true);
      container.start();
    } catch (SlickException e) {
      LoggingTools.error("application init failure");
      e.printStackTrace();
    }

    LoggingTools.debug("Application end");
  }

}
